<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>

<body>
    <script>
        console.log(Boolean(false)); //false
        console.log(Boolean('0')); //true
        console.log(Boolean('')); //false
        console.log(Boolean(NaN)); //false

        console.log(Boolean(true)) // true
        console.log(Boolean(false)) // false
        console.log(Boolean('Hello Wolrd')) // true
        console.log(Boolean()) // false
        console.log(Boolean('')) // false
        console.log(Boolean(' ')) // true (里面有空格)
        console.log(Boolean(1)) // true
        console.log(Boolean(0)) // false
        console.log(Boolean(NaN)) // false
        console.log(Boolean({})) // true
        console.log(Boolean([])) // true
        console.log(Boolean(null)) // false
        console.log(Boolean(undefined)) // false

        // 只有0、NaN、''、null、undefined五个值转换为false，其余都转换为true（而且没有任何的特殊情况）
    </script>
</body>

</html>